package com.edu.neusoft.student.domain;

import lombok.Data;

import javax.validation.constraints.*;
import java.util.Date;

@Data
public class Salesperson {

    @NotNull(message = "Salesperson ID cannot be null")
    private Integer salespersonid;

    @NotBlank(message = "First name is required")
    @Size(max = 50, message = "First name must be at most 50 characters long")
    private String firstname;

    @NotBlank(message = "Last name is required")
    @Size(max = 50, message = "Last name must be at most 50 characters long")
    private String lastname;

    @Pattern(regexp = "^\\+?[0-9]{1,15}$", message = "Phone number is invalid")
    private String phone;

    @Email(message = "Email should be valid")
    @Size(max = 100, message = "Email should be at most 100 characters long")
    private String email;

    @NotNull(message = "Hire date is required")
    @PastOrPresent(message = "Hire date cannot be in the future")
    private Date hiredate;
}
